<extend name="Public:base"/>

<block name="main">
<style>
.form-table td.td_indent{text-indent: 10px;}
.selectstyle{height: 22px;line-height: 22px;margin: 4px 0;}
</style>
<load href="__JS__/swfupload.js"/>

<div id="yzh-content" class="col-xs-12">
  <div class="table-header">单页管理</div>

  <div class="dataTables_wrapper">
    <form name="myform" id="myform" action="<if condition="$action_name=='add'">{:U('Page/insert')}<else />{:U('Page/update')}</if>&iscreatehtml=1" method="post">
      <div id="filelist" class="hide"></div>
      <div class="error"><ul></ul></div>
        <table class="form-table">
          <tbody>
          <tr>
            <td width="10%" class="td_indent" ><div class="selectstyle"><font color="red">*</font>标题</div></td>
            <td width="88%" id="box_title">
            <input type="text" class="input-text input-title f_l " name="title" id="title" value="{$vo['title']}" readonly="readonly">
            </td>
          </tr>
          <tr>
            <td class="td_indent" width="10%"><div class="selectstyle">内容</div></td>
            <td width="88%" id="box_content">
              <div style="display:none;" id="content_aid_box"></div>

              <textarea name="content" id="content" boxid="content" style="width: 99%; height: 300px; visibility: hidden; display: none;">{$vo['content']}</textarea>
            </td>
          </tr>
          </tbody>
        </table>
      <div id="bootline"></div>
      <div id="btnbox" class="btn">
        <input type="hidden" name="id" value="{$Think.get.id}">
        <input type="hidden" name="lang" value="{$langid}" />
        <input type="hidden" name="forward" value="{$_SERVER['HTTP_REFERER']}" />
        <input type="submit" value="{:L('dosubmit')}" class="btn btn-sm btn-primary" >
        <input type="reset" value="{:L('cancel')}" class="btn btn-sm btn-primary">
      </div>
    </form>
  </div>
</div>
<script type="text/javascript" src="__STATIC__/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
KindEditor.ready(function(K) {
  K.create('#content', {
    cssPath : '/Public/static/kindeditor/plugins/code/prettify.css',
    fileManagerJson:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=20&file_types=jpg,jpeg,gif,png,doc,docx,rar,zip,swf&file_size=5&moduleid=1&auth=03665ip6E4YS7tgbxBytG3St0OYqJCJ+YYCEjMD8l0SEmHSncP0syRnWN6zyS1IOujglPW8GFwo882jnFjMQZVkRMUo+I0J5wmrTAltR0w&l=zh-cn',
    editorid:'content',
    upImgUrl:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=1&file_types=gif,jpg,jpeg,png,bmp&file_size=5&moduleid=1&auth=14caN5eAor2hNmI46GNASXi5wT+r7qytNH1DwLikZyUdxu4PFjSXbHqnDNNnIPdRsV6penfzRTmLhbVnQQ&l=zh-cn',
    upFlashUrl:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=1&file_types=swf,flv&file_size=5&moduleid=1&auth=211ekeme5vPfm/xBs2vG2Wf78Wa058QEEDoSKvlFtbcfCvrYrD4weTUwonFc2cyG&l=zh-cn',
    upMediaUrl:'/index.php?g=Admin&m=Attachment&a=index&isadmin=1&more=1&isthumb=0&file_limit=1&file_types=mpg,wmv,avi,wma,mp3,mid,asf,rm,rmvb,wav,wma,mp4&file_size=5&moduleid=1&auth=c55e5KSDQ++y/l9TdkJ681dz4/uSBALNN28De1TsVdDPR6ft8+4Drnqe1LzADJNU9eeO7zGqF/UrosP3lTE1ruI5su3g+yQe5iFueMzAmSpB2ekI+8M2uQ&l=zh-cn',
    allowFileManager : true,
    filterMode: false,
    hunqinglineTag:'br',
    afterBlur: function () { this.sync(); }
  });


});

</script>

<script type="text/javascript">
$(document).ready(function() {
  $('#myform').ajaxForm({
    success:  complete,  // post-submit callback
    dataType: 'json'
  });
});

function complete(data){
  if(data.status==1){
    $.scojs_message('修改成功', $.scojs_message.TYPE_OK);
    setTimeout(function(){
      window.location.href = '{:U("Page/index")}';
    },1000);
  }else{
    $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
  }

}
</script>
</block>